Integrand size = 23, antiderivative size = 86 \[ \int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx=\frac {a x}{b^2}-\frac {2 \sqrt {a-b} \sqrt {a+b} \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^2 d}-\frac {a \tan (c+d x)}{b d (b+a \sec (c+d x))} \]
[Out]
Time = 0.22 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {4008, 4004, 3916, 2738, 211} \[ \int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx=-\frac {2 \sqrt {a-b} \sqrt {a+b} \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^2 d}+\frac {a x}{b^2}-\frac {a \tan (c+d x)}{b d (a \sec (c+d x)+b)} \]
[In]
[Out]
Rule 211
Rule 2738
Rule 3916
Rule 4004
Rule 4008
Rubi steps \begin{align*} \text {integral}& = -\frac {a \tan (c+d x)}{b d (b+a \sec (c+d x))}+\frac {\int \frac {a \left (a^2-b^2\right )+b \left (a^2-b^2\right ) \sec (c+d x)}{b+a \sec (c+d x)} \, dx}{b \left (a^2-b^2\right )} \\ & = \frac {a x}{b^2}-\frac {a \tan (c+d x)}{b d (b+a \sec (c+d x))}-\frac {\left (a^2-b^2\right ) \int \frac {\sec (c+d x)}{b+a \sec (c+d x)} \, dx}{b^2} \\ & = \frac {a x}{b^2}-\frac {a \tan (c+d x)}{b d (b+a \sec (c+d x))}-\frac {\left (a^2-b^2\right ) \int \frac {1}{1+\frac {b \cos (c+d x)}{a}} \, dx}{a b^2} \\ & = \frac {a x}{b^2}-\frac {a \tan (c+d x)}{b d (b+a \sec (c+d x))}-\frac {\left (2 \left (a^2-b^2\right )\right ) \text {Subst}\left (\int \frac {1}{1+\frac {b}{a}+\left (1-\frac {b}{a}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a b^2 d} \\ & = \frac {a x}{b^2}-\frac {2 \sqrt {a-b} \sqrt {a+b} \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^2 d}-\frac {a \tan (c+d x)}{b d (b+a \sec (c+d x))} \\ \end{align*}
Time = 0.87 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.13 \[ \int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx=\frac {2 \sqrt {-a^2+b^2} \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a^2+b^2}}\right )+\frac {a (a c+a d x+b (c+d x) \cos (c+d x)-b \sin (c+d x))}{a+b \cos (c+d x)}}{b^2 d} \]
[In]
[Out]
Time = 0.82 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.40
method | result | size |
derivativedivides | \(\frac {\frac {2 a \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2}}-\frac {2 \left (\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b +a +b}+\frac {\left (a^{2}-b^{2}\right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{2}}}{d}\) | \(120\) |
default | \(\frac {\frac {2 a \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2}}-\frac {2 \left (\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b +a +b}+\frac {\left (a^{2}-b^{2}\right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{2}}}{d}\) | \(120\) |
risch | \(\frac {a x}{b^{2}}-\frac {2 i a \left ({\mathrm e}^{i \left (d x +c \right )} a +b \right )}{d \,b^{2} \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+2 \,{\mathrm e}^{i \left (d x +c \right )} a +b \right )}+\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \sqrt {-a^{2}+b^{2}}+a}{b}\right )}{d \,b^{2}}-\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i \sqrt {-a^{2}+b^{2}}-a}{b}\right )}{d \,b^{2}}\) | \(160\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 279, normalized size of antiderivative = 3.24 \[ \int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx=\left [\frac {2 \, a b d x \cos \left (d x + c\right ) + 2 \, a^{2} d x - 2 \, a b \sin \left (d x + c\right ) + \sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right )}{2 \, {\left (b^{3} d \cos \left (d x + c\right ) + a b^{2} d\right )}}, \frac {a b d x \cos \left (d x + c\right ) + a^{2} d x - a b \sin \left (d x + c\right ) - \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right )}{b^{3} d \cos \left (d x + c\right ) + a b^{2} d}\right ] \]
[In]
[Out]
\[ \int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx=\int \frac {a + b \sec {\left (c + d x \right )}}{\left (a \sec {\left (c + d x \right )} + b\right )^{2}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.62 \[ \int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx=\frac {\frac {{\left (d x + c\right )} a}{b^{2}} - \frac {2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a + b\right )} b} - \frac {2 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )} \sqrt {a^{2} - b^{2}}}{b^{2}}}{d} \]
[In]
[Out]
Time = 14.98 (sec) , antiderivative size = 444, normalized size of antiderivative = 5.16 \[ \int \frac {a+b \sec (c+d x)}{(b+a \sec (c+d x))^2} \, dx=\frac {2\,\mathrm {atanh}\left (\frac {64\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{64\,a^4-128\,a^3\,b+128\,a\,b^3-64\,b^4}-\frac {192\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{128\,a\,b^2-128\,a^3-64\,b^3+\frac {64\,a^4}{b}}+\frac {192\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{128\,a\,b-64\,b^2-\frac {128\,a^3}{b}+\frac {64\,a^4}{b^2}}-\frac {64\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{128\,a\,b-64\,b^2-\frac {128\,a^3}{b}+\frac {64\,a^4}{b^2}}\right )\,\sqrt {b^2-a^2}}{b^2\,d}-\frac {2\,a\,\mathrm {atan}\left (\frac {64\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a\,b-64\,a^2-\frac {64\,a^3}{b}+\frac {64\,a^4}{b^2}}+\frac {64\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a\,b^2-64\,a^2\,b-64\,a^3+\frac {64\,a^4}{b}}-\frac {64\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a^4-64\,a^3\,b-64\,a^2\,b^2+64\,a\,b^3}-\frac {64\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a\,b-64\,a^2-\frac {64\,a^3}{b}+\frac {64\,a^4}{b^2}}\right )}{b^2\,d}-\frac {2\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b\,d\,\left (\left (a-b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a+b\right )} \]
[In]
[Out]